var express = require('express');
var router = express.Router();
let multiparty = require("multiparty");
let xlsx = require("node-xlsx");
let fs = require('fs')
let jwt = require('jsonwebtoken')
let { User, Path } = require('../model/model.js')
router.post('/login', async (req, res) => {
    res.send({ status: 200, msg: '登录成功', token: '123' })
    // let { username, password } = req.body
    // let result = await User.findOne({ password })
    // if (result) {
    //     let token = jwt.sign({ username, password }, 'secret', { expiresIn: '1h' })
    //     res.send({ status: 200, msg: '登录成功', token })
    // } else {
    //     res.send({ status: 400, msg: '用户名或密码错误' })
    // }
})
router.get('/login', async (req, res) => {
    let data = await User.find()
    console.log(data);
    
    res.send({
        status: 200,
        data
    })
})
module.exports = router;
